package com.bcinfo.iccard.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.bcinfo.iccard.model.Merchant;

public interface MerchantMapper
{
    int deleteByPrimaryKey(Long merchantId);

    int insert(Merchant record);

    int insertSelective(Merchant record);

    Merchant selectByPrimaryKey(Long merchantId);
    Merchant selectByPrimaryKeyForAudit(Long merchantId);

    List<Merchant> selectByNameCode(@Param("keyword") String keyword, @Param("maxRows") int maxRows);

    int updateByPrimaryKeySelective(Merchant record);

    int updateByPrimaryKey(Merchant record);

    int selectCountByStatusAndType(@Param("merchantEncode") String merchantEncode,@Param("merchantCheckStatus") int merchantCheckStatus,
            @Param("merchantType") int merchantType,@Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<Merchant> selectByPage(@Param("merchantEncode") String merchantEncode,
            @Param("merchantCheckStatus") int merchantCheckStatus, @Param("merchantType") int merchantType,
            @Param("beginTime") String beginTime, @Param("endTime") String endTime,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);

    List<Merchant> selectAll();

    //Merchant selectByMerchantEncode(@Param("merchantEncode") String merchantEncode,@Param("merchantId") String merchantId);
    int selectByMerchantEncode(String merchantEncode);

    /**
     * 
     * 一句话描述 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: xug<br/>
     * <p>
     * Date: 2013-12-13-下午03:07:45<br/>
     * <p>
     * 
     * @param merchantName
     * @param type
     *            1、新增时的判断，2、修改时的判断
     * @return
     * 
     */
    //int selectByMerchantName(@Param("merchantName") String merchantName,@Param("merchantId") String merchantId);
    int selectByMerchantName(String merchantName);
    Merchant selectByEnCode(String merchantEncode);

    /**
     * 一句话描述 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-17-下午04:37:02<br/>
     * <p>
     * 
     * @param merchantCode
     * @param merchantCheckStatus
     * @param merchantStatus
     * @return
     * 
     */
    int selectCountByCodeAndStatus(@Param("merchantCode") String merchantCode,
            @Param("merchantCheckStatus") Short merchantCheckStatus, @Param("merchantStatus") Short merchantStatus);

    /**
     * 一句话描述 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: Administrator<br/>
     * <p>
     * Date: 2013-12-17-下午04:37:25<br/>
     * <p>
     * 
     * @param merchantCode
     * @param merchantCheckStatus
     * @param merchantStatus
     * @param benginIndex
     * @param pageSize
     * @return
     * 
     */
    List<Merchant> selectPageByCodeAndStatus(@Param("merchantCode") String merchantCode,
            @Param("merchantCheckStatus") Short merchantCheckStatus, @Param("merchantStatus") Short merchantStatus,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);

}